Post

Replies

Boosts

Views

Activity

Reply to How to detect whether it is self-dragging or not in SwiftUI?
Here is some code snippets: ... ForEach(pngs) { row in TableRow(row) .itemProvider { row.targetURL.flatMap(NSItemProvider.init(contentsOf:)) } } ... .onDrop(of: [.png], isTargeted: $isDropTarget) { providers in files.removeAll() providers.forEach { provider in _ = provider.loadFileRepresentation(for: .png, openInPlace: true) { url, _, _ in Task { @MainActor in url.map { files.append(.init(url: $0)) } } } } return true } ...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to How to detect whether it is self-dragging or not in SwiftUI?
Here is some code snippets: ... ForEach(pngs) { row in TableRow(row) .itemProvider { row.targetURL.flatMap(NSItemProvider.init(contentsOf:)) } } ... .onDrop(of: [.png], isTargeted: $isDropTarget) { providers in files.removeAll() providers.forEach { provider in _ = provider.loadFileRepresentation(for: .png, openInPlace: true) { url, _, _ in Task { @MainActor in url.map { files.append(.init(url: $0)) } } } } return true } ...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Unable perform AppIntent in interactive Widget
Got fixed! TimerType and TimerAction can not both conform to AppEnum and AppEntity protocols. Remove the AppEntity, it will work.
Replies
Boosts
Views
Activity
Aug ’25